//
//  SYS_CustomFiled.m
//  System_App
//
//  Created by 魏配军 on 2017/11/28.
//  Copyright © 2017年 czy001. All rights reserved.
//

#import "SYS_CustomFiled.h"

@implementation SYS_CustomFiled

-(void)drawPlaceholderInRect:(CGRect)rect
{
    double systemVersion = [UIDevice currentDevice].systemVersion.doubleValue;
    float height=0.0;
    if (systemVersion < 11.0) {
        height=3;
    }
    self.clearButtonMode=UITextFieldViewModeWhileEditing;
    [self.placeholder drawInRect:CGRectMake(0, height, rect.size.width, rect.size.height) withAttributes:@{
                                                                                                      NSForegroundColorAttributeName:DGHColorAlpha(168, 168, 168, 1),NSFontAttributeName:[UIFont systemFontOfSize:12]


                                                                                                      }];
}

- (BOOL)canPerformAction:(SEL)action withSender:(id)sender
{
    if (action == @selector(paste:)) {//禁止粘贴
        return NO;
    }
    if (action == @selector(select:)) {//禁止选中
        return NO;
    }
    if (action == @selector(selectAll:)) {//禁止全选
        return NO;
    }
    return [super canPerformAction:action withSender:sender];
}



@end
